home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / STUTTGART / LANG / C / LIB / YLIB / ylib_0_10 / Readme < prev    next >
Text File  |  1993-09-21  |  4KB  |  109 lines

  1. Program:  ylib
  2. Purpose:  speed-up of math operations.
  3. Author:   Claus Vohwinkel
  4. E-mail:   vohwinkel@vxdesy.desy.de
  5. Version:  ylib version 0.10
  6. Required: FPA10
  7. Machines: It has been compiled and run in the following environment:
  8.           Acorn 410/1  4Mb ram  FPA10
  9.           FPemulator 4.01
  10.           CC version 4.0  Clib version 3.99
  11.  
  12.  
  13. ylib is a package of routines which will speed up most of the math functions
  14. by a factor of about 3.
  15.  
  16.  
  17. ylib comes in 2 flavours.
  18. The first one is the object library O.YLIB_OBJ, which should be used with
  19. the header file ymath.h.
  20. ylib_obj.o defines routines ysin,ycos,... . By default, the header file
  21. sets up macros to translate sin to ysin etc. You can disable this translation
  22. by using
  23. #define no_y_trans
  24. before including ymath.h
  25. ylib_obj contains 2 routines which are not available in the other version,
  26. namely exm1, which computes exp(x)-1, taking care of loss of significance
  27. for x around 0,
  28. and twotox which computes 2**x.
  29.  
  30. The second version of ylib is the module YLIB_MOD, which hacks its way into the
  31. Shared CLibrary by intercepting the SWIs which are used to link the
  32. Library to an application. This is the preferred way of using ylib cause
  33. the decision whether the ylib routines are used is made at run-time.
  34. ylib_mod must be loaded after the CLib.
  35.  
  36. To take full adavantage of ylib you should modify the math.h header file.
  37. It contains #defines to map some functions to inline functions, which
  38. will then be emulated rather slowly.
  39. In my version of the C compiler (4.0) these are
  40. atan, sin and cos and fabs.
  41. You should delete the defines for atan,sin and cos, but NOT for fabs.
  42. Further you have to include the math file by
  43. #include "math.h"
  44. rather than by
  45. #include <math.h>
  46. cause in the second case the compiler will use an internal file.
  47. If you do not do this changes no harm is done, but atan, sin and cos will
  48. remain slow.
  49. (if you use the changed header file and do not use ylib,
  50.  sin,cos and atan will be about 10 percent slower than usual)
  51.  
  52. Once the module is loaded the module name is FastMath.
  53. It provides a command
  54. FastMath [-on|-off] [-verbose].
  55. Fastmath without parameters returns the current status.
  56. With -on or -off you control whether applications are linked with the ylib
  57. routines or with the CLib routines.
  58. If you specify -verbose a message is printed each time an application is
  59. linked with ylib.
  60.  
  61. Currently the module refuses to die, after it has been linked at least once
  62. to an application (it has no way of telling if the application is still active).
  63.  
  64. -------------------------------------------------------------------------
  65.  
  66. While some routines are homemade, most of them are based on:
  67.   John F. Hart  et. al.
  68.   Computer Approximations
  69.   
  70.   John Wiley & Sons, Inc., New York, London, Sidney
  71.   1968
  72.  
  73. --------------------------------------------------------------------------
  74. Further comments:
  75. ylib is not intended to be used in supervisor mode.
  76. The ylib_mod version does not link modules to the ylib routines.
  77.  
  78. I think that for some routines and arguments Nan,inf,minf there is
  79. some severe degradation of performance.
  80. The handling of NaNs might be not quite correct, in that sense that
  81. a different than the original NaN is returned.
  82.  
  83. Don't ask me why I called the whole thing ylib...
  84. --------------------------------------------------------------
  85.     Copyright (C) 1993  Claus Vohwinkel
  86.  
  87.     This program is free software; you can redistribute it and/or modify
  88.     it under the terms of the GNU General Public License as published by
  89.     the Free Software Foundation; either version 2 of the License , or
  90.     (at your option) any later version.
  91.  
  92.     This program is distributed in the hope that it will be useful,
  93.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  94.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  95.     GNU General Public License for more details.
  96.  
  97.     You should have received a copy of the GNU General Public License
  98.     along with this program; see the file COPYING.  If not, write to
  99.     the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  100.  
  101.     You may contact the author by:
  102.        e-mail:  vohwinkel@vxdesy.desy.de
  103.       us-mail:  Claus Vohwinkel
  104.                 SCRI/FSU
  105.                 400 Science Library
  106.                 Tallahassee, FL 32306
  107.       
  108.  
  109.